const DATA = require("./Baltic_Squad_KillGroggyBluezone_TIME.json");
const lodash = require("lodash");
const fs = require("fs-extra");
const path = require("path");

let die_ev_time = DATA.DIE_EVS_TIME.concat(DATA.GROGGY_EVS_TIME).sort((a, b) => a - b)
let uniq_ed = lodash.uniq(die_ev_time);
/**
 * @type {Array<{
 * timestamp:Number,
 * died_count:Number
 * }>}
 */
let result = [];

for(let i = 0;i<die_ev_time.length;){i
  let filtered = die_ev_time.filter(e=>e==die_ev_time[i]);
  if(filtered.length>=2){
    console.log(die_ev_time[i],"has",filtered.length)
  }
  result.push({
    timestamp:die_ev_time[i],
    died_count:filtered.length+i
  })
  i+=filtered.length;
}
debugger

fs.writeFile(path.join(__dirname,"Baltic_Squad_挨打人数随时间的变化.json"),JSON.stringify({
  data:result
})).then(_=>{
  process.exit()
})

